package com.leo.hbase.mapreduce;

import com.leo.hbase.mapreduce.exception.DbException;
import com.leo.hbase.mapreduce.service.ByteIterator;
import com.leo.hbase.mapreduce.service.HbaseClient;

import java.util.Map;

/**
 * @author leo.jie (weixiao.me@aliyun.com)
 * @version 1.0
 * @organization CC
 * @website https://www.jlpyyf.com
 * @date 2019/11/13 11:10 下午
 * @since 1.0
 */
public class HbaseClientTest {
    public static void main(String[] args) throws DbException {
        HbaseClient hbaseClient = new HbaseClient();
        hbaseClient.init();
        Map<String, ByteIterator> result = hbaseClient.read("leo_test1",
                "info", "0001", null);
        result.forEach((key, value) -> {
            System.out.println(key);
            while (value.hasNext()) {
                System.out.println(Byte.toString(value.nextByte()));
            }
        });
    }
}
